-- GENERATED SPELL FOR [Auchenai Soulpriest] --


function spell0_18493(pUnit, Event) --@Falter,Self--
pUnit:FullCastSpellOnTarget(32859,pUnit)
pUnit:RegisterEvent('Sorts_18493', 5252, 1)
end

function spell1_18493(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(32860,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18493', 12500, 1)
end

function spell2_18493(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(38378,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18493', 12500, 1)
end

function spell3_18493(pUnit, Event) --@Summon Phantasmal Possessor,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32857,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18493', 1, 1)
end

function spell4_18493(pUnit, Event) --@Summon Unliving Cleric,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32855,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18493', 1, 1)
end

function spell5_18493(pUnit, Event) --@Summon Unliving Soldier,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32853,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18493', 1, 1)
end

function spell6_18493(pUnit, Event) --@Summon Unliving Sorcerer,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32854,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18493', 1, 1)
end

function spell7_18493(pUnit, Event) --@Summon Unliving Stalker,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32856,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18493', 1, 1)
end

function spell8_18493(pUnit, Event) --@Touch of the Forgotten,Heal--
pUnit:FullCastSpellOnTarget(32858,pUnit)
pUnit:RegisterEvent('Sorts_18493', 1000, 1)
end

function spell9_18493(pUnit, Event) --@Touch of the Forgotten,Heal--
pUnit:FullCastSpellOnTarget(38377,pUnit)
pUnit:RegisterEvent('Sorts_18493', 1000, 1)
end

function Sorts_18493(pUnit, Event)
local choix_sorts_18493 = math.random(0, 9)
if choix_sorts_18493 == 0 then
pUnit:RegisterEvent('spell0_18493', 1, 1)
end
if choix_sorts_18493 == 1 then
pUnit:RegisterEvent('spell1_18493', 1, 1)
end
if choix_sorts_18493 == 2 then
pUnit:RegisterEvent('spell2_18493', 1, 1)
end
if choix_sorts_18493 == 3 then
pUnit:RegisterEvent('spell3_18493', 1, 1)
end
if choix_sorts_18493 == 4 then
pUnit:RegisterEvent('spell4_18493', 1, 1)
end
if choix_sorts_18493 == 5 then
pUnit:RegisterEvent('spell5_18493', 1, 1)
end
if choix_sorts_18493 == 6 then
pUnit:RegisterEvent('spell6_18493', 1, 1)
end
if choix_sorts_18493 == 7 then
pUnit:RegisterEvent('spell7_18493', 1, 1)
end
if choix_sorts_18493 == 8 then
pUnit:RegisterEvent('spell8_18493', 1, 1)
end
if choix_sorts_18493 == 9 then
pUnit:RegisterEvent('spell9_18493', 1, 1)
end
end

function mob18493_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18493', math.random(1500, 3000), 1)
end

function mob18493_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18493_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18493_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18493, 1, 'mob18493_Action')
RegisterUnitEvent(18493, 2, 'mob18493_Leave')
RegisterUnitEvent(18493, 3, 'mob18493_Kill')
RegisterUnitEvent(18493, 4, 'mob18493_Die')
